<?php

namespace App\Http\Controllers;

use App\Logic\ToolLogic;
use App\Exceptions\ApiException;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;

class ToolController extends Controller
{
    /**
     * 获取每日一签
     * @param Request $request
     * @return JsonResponse
     */
    public function cq(Request $request): JsonResponse
    {
        try {
            $logic = new ToolLogic();
            $content = $logic->cq();
            return $this->OkJson(['content' => $content]);
        } catch (ApiException $e) {
            return $this->ErrJson($e->getMessage());
        }
    }
} 